package com.ruoyi.web.controller.equ;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.service.ISysNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/equ/notice")
public class EquNoticeController extends BaseController {
    @Autowired
    private ISysNoticeService noticeService;
    /**
     * 获取个人通知列表
     */
    @PreAuthorize("@ss.hasPermi('equ:notice:list')")
    @GetMapping("/myNotice")
    public TableDataInfo getMyNotice()
    {
        Long userId = SecurityUtils.getUserId();
        List<SysNotice> list = noticeService.getMyNoticeByAcceptId(userId);
        return getDataTable(list);
    }

    /**
     * 发送短信
     */
//    @GetMapping("/myNotice")
//    public AjaxResult sendMsg()
//    {
//        String assetName = "心电图机";
//
//        return getDataTable(list);
//    }
}
